//index.js
//获取应用实例
const app = getApp()

Page({

   data: {
     
     

   },

   goRegistPage: function () {
      //注册界面跳转 
      wx.redirectTo({
         url: '../userRegist/regist',
      })
   }
   ,
   goLoginPage: function () {
      wx.redirectTo({
         url: '../userLogin/login',
      })
   },

   uploadBgm: function () {
      wx.chooseMessageFile({
         count: 1,
         success(res) {
            console.log(res)
            wx.uploadFile({
               filePath: res.tempFiles[0].path,
               name: 'bgm',
               url: app.serverUrl + '/bgm/uploadBgm',
               formData: {
                  "bgmName": res.tempFiles[0].name,
                  "bgmAuthor": "作者",
               },
               success: function (res) {

                  console.log(res)
               }
            })




         }
      })

   }






})
